/* tslint:disable */
/* eslint-disable */
/*
Humanloop API

The Humanloop API allows you to interact with Humanloop from your product or service.

You can do this through HTTP requests from any language or via our official Python or TypeScript SDK.

To install the official [Python SDK](https://pypi.org/project/humanloop/), run the following command:

```bash
pip install humanloop
```

To install the official [TypeScript SDK](https://www.npmjs.com/package/humanloop), run the following command:

```bash
npm i humanloop
```

---

Guides and further details about key concepts can be found in [our docs](https://docs.humanloop.com/).

The version of the OpenAPI document: 4.0.1


NOTE: This file is auto generated by Konfig (https://konfigthis.com).
*/

import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
import { Configuration } from '../configuration';
// Some imports not used depending on template conditions
// @ts-ignore
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction, isBrowser } from '../common';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
// @ts-ignore
import { CreateEvaluationRequest } from '../models';
// @ts-ignore
import { CreateEvaluationResultLogRequest } from '../models';
// @ts-ignore
import { EvaluationResponse } from '../models';
// @ts-ignore
import { EvaluationResultResponse } from '../models';
// @ts-ignore
import { EvaluationStatus } from '../models';
// @ts-ignore
import { HTTPValidationError } from '../models';
// @ts-ignore
import { PaginatedDataEvaluationDatapointSnapshotResponse } from '../models';
// @ts-ignore
import { ProviderApiKeys } from '../models';
// @ts-ignore
import { UpdateEvaluationStatusRequest } from '../models';
// @ts-ignore
import { ValueProperty } from '../models';
import { paginate } from "../pagination/paginate";
import type * as buffer from "buffer"
import { requestBeforeHook } from '../requestBeforeHook';
/**
 * EvaluationsApi - axios parameter creator
 * @export
 */
export const EvaluationsApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * Create an evaluation.
         * @summary Create
         * @param {string} projectId String ID of project. Starts with &#x60;pr_&#x60;.
         * @param {CreateEvaluationRequest} createEvaluationRequest 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        create: async (projectId: string, createEvaluationRequest: CreateEvaluationRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'projectId' is not null or undefined
            assertParamExists('create', 'projectId', projectId)
            // verify required parameter 'createEvaluationRequest' is not null or undefined
            assertParamExists('create', 'createEvaluationRequest', createEvaluationRequest)
            const localVarPath = `/projects/{project_id}/evaluations`
                .replace(`{${"project_id"}}`, encodeURIComponent(String(projectId !== undefined ? projectId : `-project_id-`)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions: AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
            const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {} as any;
            const localVarQueryParameter = {} as any;

            // authentication APIKeyHeader required
            await setApiKeyToObject({ object: localVarHeaderParameter, key: "X-API-KEY", keyParamName: "xAPIKEY", configuration })

    
            localVarHeaderParameter['Content-Type'] = 'application/json';


            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            requestBeforeHook({
                requestBody: createEvaluationRequest,
                queryParameters: localVarQueryParameter,
                requestConfig: localVarRequestOptions,
                path: localVarPath,
                configuration,
                pathTemplate: '/projects/{project_id}/evaluations',
                httpMethod: 'POST'
            });
            localVarRequestOptions.data = serializeDataIfNeeded(createEvaluationRequest, localVarRequestOptions, configuration)

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Get evaluation by ID.
         * @summary Get
         * @param {string} id String ID of evaluation run. Starts with &#x60;ev_&#x60;.
         * @param {boolean} [evaluatorAggregates] Whether to include evaluator aggregates in the response.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        get: async (id: string, evaluatorAggregates?: boolean, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('get', 'id', id)
            const localVarPath = `/evaluations/{id}`
                .replace(`{${"id"}}`, encodeURIComponent(String(id !== undefined ? id : `-id-`)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions: AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {} as any;
            const localVarQueryParameter = {} as any;

            // authentication APIKeyHeader required
            await setApiKeyToObject({ object: localVarHeaderParameter, key: "X-API-KEY", keyParamName: "xAPIKEY", configuration })
            if (evaluatorAggregates !== undefined) {
                localVarQueryParameter['evaluator_aggregates'] = evaluatorAggregates;
            }


    
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            requestBeforeHook({
                queryParameters: localVarQueryParameter,
                requestConfig: localVarRequestOptions,
                path: localVarPath,
                configuration,
                pathTemplate: '/evaluations/{id}',
                httpMethod: 'GET'
            });

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Get all the evaluations associated with your project.
         * @summary List For Project
         * @param {string} projectId String ID of project. Starts with &#x60;pr_&#x60;.
         * @param {boolean} [evaluatorAggregates] Whether to include evaluator aggregates in the response.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listAllForProject: async (projectId: string, evaluatorAggregates?: boolean, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'projectId' is not null or undefined
            assertParamExists('listAllForProject', 'projectId', projectId)
            const localVarPath = `/projects/{project_id}/evaluations`
                .replace(`{${"project_id"}}`, encodeURIComponent(String(projectId !== undefined ? projectId : `-project_id-`)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions: AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {} as any;
            const localVarQueryParameter = {} as any;

            // authentication APIKeyHeader required
            await setApiKeyToObject({ object: localVarHeaderParameter, key: "X-API-KEY", keyParamName: "xAPIKEY", configuration })
            if (evaluatorAggregates !== undefined) {
                localVarQueryParameter['evaluator_aggregates'] = evaluatorAggregates;
            }


    
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            requestBeforeHook({
                queryParameters: localVarQueryParameter,
                requestConfig: localVarRequestOptions,
                path: localVarPath,
                configuration,
                pathTemplate: '/projects/{project_id}/evaluations',
                httpMethod: 'GET'
            });

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Get testcases by evaluation ID.
         * @summary List Datapoints
         * @param {string} id String ID of evaluation. Starts with &#x60;ev_&#x60;.
         * @param {number} [page] Page to fetch. Starts from 1.
         * @param {number} [size] Number of evaluation results to retrieve.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listDatapoints: async (id: string, page?: number, size?: number, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('listDatapoints', 'id', id)
            const localVarPath = `/evaluations/{id}/datapoints`
                .replace(`{${"id"}}`, encodeURIComponent(String(id !== undefined ? id : `-id-`)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions: AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {} as any;
            const localVarQueryParameter = {} as any;

            // authentication APIKeyHeader required
            await setApiKeyToObject({ object: localVarHeaderParameter, key: "X-API-KEY", keyParamName: "xAPIKEY", configuration })
            if (page !== undefined) {
                localVarQueryParameter['page'] = page;
            }

            if (size !== undefined) {
                localVarQueryParameter['size'] = size;
            }


    
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            requestBeforeHook({
                queryParameters: localVarQueryParameter,
                requestConfig: localVarRequestOptions,
                path: localVarPath,
                configuration,
                pathTemplate: '/evaluations/{id}/datapoints',
                httpMethod: 'GET'
            });

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Log an evaluation result to an evaluation run.  The run must have status \'running\' and the `evaluator_id` of the result must be one of the `evaluator_id`s associated with the run.
         * @summary Log Result
         * @param {string} evaluationRunExternalId ID of the evaluation run. Starts with &#x60;evrun_&#x60;.
         * @param {CreateEvaluationResultLogRequest} createEvaluationResultLogRequest 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        logResult: async (evaluationRunExternalId: string, createEvaluationResultLogRequest: CreateEvaluationResultLogRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'evaluationRunExternalId' is not null or undefined
            assertParamExists('logResult', 'evaluationRunExternalId', evaluationRunExternalId)
            // verify required parameter 'createEvaluationResultLogRequest' is not null or undefined
            assertParamExists('logResult', 'createEvaluationResultLogRequest', createEvaluationResultLogRequest)
            const localVarPath = `/evaluations/{evaluation_run_external_id}/result`
                .replace(`{${"evaluation_run_external_id"}}`, encodeURIComponent(String(evaluationRunExternalId !== undefined ? evaluationRunExternalId : `-evaluation_run_external_id-`)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions: AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
            const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {} as any;
            const localVarQueryParameter = {} as any;

            // authentication APIKeyHeader required
            await setApiKeyToObject({ object: localVarHeaderParameter, key: "X-API-KEY", keyParamName: "xAPIKEY", configuration })

    
            localVarHeaderParameter['Content-Type'] = 'application/json';


            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            requestBeforeHook({
                requestBody: createEvaluationResultLogRequest,
                queryParameters: localVarQueryParameter,
                requestConfig: localVarRequestOptions,
                path: localVarPath,
                configuration,
                pathTemplate: '/evaluations/{evaluation_run_external_id}/result',
                httpMethod: 'POST'
            });
            localVarRequestOptions.data = serializeDataIfNeeded(createEvaluationResultLogRequest, localVarRequestOptions, configuration)

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Update the status of an evaluation run.  Can only be used to update the status of an evaluation run that uses external or human evaluators. The evaluation must currently have status \'running\' if swithcing to completed, or it must have status \'completed\' if switching back to \'running\'.
         * @summary Update Status
         * @param {string} id String ID of evaluation run. Starts with &#x60;ev_&#x60;.
         * @param {UpdateEvaluationStatusRequest} updateEvaluationStatusRequest 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateStatus: async (id: string, updateEvaluationStatusRequest: UpdateEvaluationStatusRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('updateStatus', 'id', id)
            // verify required parameter 'updateEvaluationStatusRequest' is not null or undefined
            assertParamExists('updateStatus', 'updateEvaluationStatusRequest', updateEvaluationStatusRequest)
            const localVarPath = `/evaluations/{id}/status`
                .replace(`{${"id"}}`, encodeURIComponent(String(id !== undefined ? id : `-id-`)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions: AxiosRequestConfig = { method: 'PATCH', ...baseOptions, ...options};
            const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {} as any;
            const localVarQueryParameter = {} as any;

            // authentication APIKeyHeader required
            await setApiKeyToObject({ object: localVarHeaderParameter, key: "X-API-KEY", keyParamName: "xAPIKEY", configuration })

    
            localVarHeaderParameter['Content-Type'] = 'application/json';


            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            requestBeforeHook({
                requestBody: updateEvaluationStatusRequest,
                queryParameters: localVarQueryParameter,
                requestConfig: localVarRequestOptions,
                path: localVarPath,
                configuration,
                pathTemplate: '/evaluations/{id}/status',
                httpMethod: 'PATCH'
            });
            localVarRequestOptions.data = serializeDataIfNeeded(updateEvaluationStatusRequest, localVarRequestOptions, configuration)

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
    }
};

/**
 * EvaluationsApi - functional programming interface
 * @export
 */
export const EvaluationsApiFp = function(configuration?: Configuration) {
    const localVarAxiosParamCreator = EvaluationsApiAxiosParamCreator(configuration)
    return {
        /**
         * Create an evaluation.
         * @summary Create
         * @param {EvaluationsApiCreateRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async create(requestParameters: EvaluationsApiCreateRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<EvaluationResponse>> {
            const createEvaluationRequest: CreateEvaluationRequest = {
                config_id: requestParameters.config_id,
                evaluator_ids: requestParameters.evaluator_ids,
                dataset_id: requestParameters.dataset_id,
                provider_api_keys: requestParameters.provider_api_keys
            };
            const localVarAxiosArgs = await localVarAxiosParamCreator.create(requestParameters.projectId, createEvaluationRequest, options);
            return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
        },
        /**
         * Get evaluation by ID.
         * @summary Get
         * @param {EvaluationsApiGetRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async get(requestParameters: EvaluationsApiGetRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<EvaluationResponse>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.get(requestParameters.id, requestParameters.evaluatorAggregates, options);
            return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
        },
        /**
         * Get all the evaluations associated with your project.
         * @summary List For Project
         * @param {EvaluationsApiListAllForProjectRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listAllForProject(requestParameters: EvaluationsApiListAllForProjectRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<EvaluationResponse>>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.listAllForProject(requestParameters.projectId, requestParameters.evaluatorAggregates, options);
            return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
        },
        /**
         * Get testcases by evaluation ID.
         * @summary List Datapoints
         * @param {EvaluationsApiListDatapointsRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listDatapoints(requestParameters: EvaluationsApiListDatapointsRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PaginatedDataEvaluationDatapointSnapshotResponse>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.listDatapoints(requestParameters.id, requestParameters.page, requestParameters.size, options);
            return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
        },
        /**
         * Log an evaluation result to an evaluation run.  The run must have status \'running\' and the `evaluator_id` of the result must be one of the `evaluator_id`s associated with the run.
         * @summary Log Result
         * @param {EvaluationsApiLogResultRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async logResult(requestParameters: EvaluationsApiLogResultRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<EvaluationResultResponse>> {
            const createEvaluationResultLogRequest: CreateEvaluationResultLogRequest = {
                log_id: requestParameters.log_id,
                evaluator_id: requestParameters.evaluator_id,
                result: requestParameters.result,
                error: requestParameters.error
            };
            const localVarAxiosArgs = await localVarAxiosParamCreator.logResult(requestParameters.evaluationRunExternalId, createEvaluationResultLogRequest, options);
            return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
        },
        /**
         * Update the status of an evaluation run.  Can only be used to update the status of an evaluation run that uses external or human evaluators. The evaluation must currently have status \'running\' if swithcing to completed, or it must have status \'completed\' if switching back to \'running\'.
         * @summary Update Status
         * @param {EvaluationsApiUpdateStatusRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async updateStatus(requestParameters: EvaluationsApiUpdateStatusRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<EvaluationResponse>> {
            const updateEvaluationStatusRequest: UpdateEvaluationStatusRequest = {
                status: requestParameters.status
            };
            const localVarAxiosArgs = await localVarAxiosParamCreator.updateStatus(requestParameters.id, updateEvaluationStatusRequest, options);
            return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
        },
    }
};

/**
 * EvaluationsApi - factory interface
 * @export
 */
export const EvaluationsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    const localVarFp = EvaluationsApiFp(configuration)
    return {
        /**
         * Create an evaluation.
         * @summary Create
         * @param {EvaluationsApiCreateRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        create(requestParameters: EvaluationsApiCreateRequest, options?: AxiosRequestConfig): AxiosPromise<EvaluationResponse> {
            return localVarFp.create(requestParameters, options).then((request) => request(axios, basePath));
        },
        /**
         * Get evaluation by ID.
         * @summary Get
         * @param {EvaluationsApiGetRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        get(requestParameters: EvaluationsApiGetRequest, options?: AxiosRequestConfig): AxiosPromise<EvaluationResponse> {
            return localVarFp.get(requestParameters, options).then((request) => request(axios, basePath));
        },
        /**
         * Get all the evaluations associated with your project.
         * @summary List For Project
         * @param {EvaluationsApiListAllForProjectRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listAllForProject(requestParameters: EvaluationsApiListAllForProjectRequest, options?: AxiosRequestConfig): AxiosPromise<Array<EvaluationResponse>> {
            return localVarFp.listAllForProject(requestParameters, options).then((request) => request(axios, basePath));
        },
        /**
         * Get testcases by evaluation ID.
         * @summary List Datapoints
         * @param {EvaluationsApiListDatapointsRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listDatapoints(requestParameters: EvaluationsApiListDatapointsRequest, options?: AxiosRequestConfig): AxiosPromise<PaginatedDataEvaluationDatapointSnapshotResponse> {
            return localVarFp.listDatapoints(requestParameters, options).then((request) => request(axios, basePath));
        },
        /**
         * Log an evaluation result to an evaluation run.  The run must have status \'running\' and the `evaluator_id` of the result must be one of the `evaluator_id`s associated with the run.
         * @summary Log Result
         * @param {EvaluationsApiLogResultRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        logResult(requestParameters: EvaluationsApiLogResultRequest, options?: AxiosRequestConfig): AxiosPromise<EvaluationResultResponse> {
            return localVarFp.logResult(requestParameters, options).then((request) => request(axios, basePath));
        },
        /**
         * Update the status of an evaluation run.  Can only be used to update the status of an evaluation run that uses external or human evaluators. The evaluation must currently have status \'running\' if swithcing to completed, or it must have status \'completed\' if switching back to \'running\'.
         * @summary Update Status
         * @param {EvaluationsApiUpdateStatusRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateStatus(requestParameters: EvaluationsApiUpdateStatusRequest, options?: AxiosRequestConfig): AxiosPromise<EvaluationResponse> {
            return localVarFp.updateStatus(requestParameters, options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * Request parameters for create operation in EvaluationsApi.
 * @export
 * @interface EvaluationsApiCreateRequest
 */
export type EvaluationsApiCreateRequest = {
    
    /**
    * String ID of project. Starts with `pr_`.
    * @type {string}
    * @memberof EvaluationsApiCreate
    */
    readonly projectId: string
    
} & CreateEvaluationRequest

/**
 * Request parameters for get operation in EvaluationsApi.
 * @export
 * @interface EvaluationsApiGetRequest
 */
export type EvaluationsApiGetRequest = {
    
    /**
    * String ID of evaluation run. Starts with `ev_`.
    * @type {string}
    * @memberof EvaluationsApiGet
    */
    readonly id: string
    
    /**
    * Whether to include evaluator aggregates in the response.
    * @type {boolean}
    * @memberof EvaluationsApiGet
    */
    readonly evaluatorAggregates?: boolean
    
}

/**
 * Request parameters for listAllForProject operation in EvaluationsApi.
 * @export
 * @interface EvaluationsApiListAllForProjectRequest
 */
export type EvaluationsApiListAllForProjectRequest = {
    
    /**
    * String ID of project. Starts with `pr_`.
    * @type {string}
    * @memberof EvaluationsApiListAllForProject
    */
    readonly projectId: string
    
    /**
    * Whether to include evaluator aggregates in the response.
    * @type {boolean}
    * @memberof EvaluationsApiListAllForProject
    */
    readonly evaluatorAggregates?: boolean
    
}

/**
 * Request parameters for listDatapoints operation in EvaluationsApi.
 * @export
 * @interface EvaluationsApiListDatapointsRequest
 */
export type EvaluationsApiListDatapointsRequest = {
    
    /**
    * String ID of evaluation. Starts with `ev_`.
    * @type {string}
    * @memberof EvaluationsApiListDatapoints
    */
    readonly id: string
    
    /**
    * Page to fetch. Starts from 1.
    * @type {number}
    * @memberof EvaluationsApiListDatapoints
    */
    readonly page?: number
    
    /**
    * Number of evaluation results to retrieve.
    * @type {number}
    * @memberof EvaluationsApiListDatapoints
    */
    readonly size?: number
    
}

/**
 * Request parameters for logResult operation in EvaluationsApi.
 * @export
 * @interface EvaluationsApiLogResultRequest
 */
export type EvaluationsApiLogResultRequest = {
    
    /**
    * ID of the evaluation run. Starts with `evrun_`.
    * @type {string}
    * @memberof EvaluationsApiLogResult
    */
    readonly evaluationRunExternalId: string
    
} & CreateEvaluationResultLogRequest

/**
 * Request parameters for updateStatus operation in EvaluationsApi.
 * @export
 * @interface EvaluationsApiUpdateStatusRequest
 */
export type EvaluationsApiUpdateStatusRequest = {
    
    /**
    * String ID of evaluation run. Starts with `ev_`.
    * @type {string}
    * @memberof EvaluationsApiUpdateStatus
    */
    readonly id: string
    
} & UpdateEvaluationStatusRequest

/**
 * EvaluationsApiGenerated - object-oriented interface
 * @export
 * @class EvaluationsApiGenerated
 * @extends {BaseAPI}
 */
export class EvaluationsApiGenerated extends BaseAPI {
    /**
     * Create an evaluation.
     * @summary Create
     * @param {EvaluationsApiCreateRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof EvaluationsApiGenerated
     */
    public create(requestParameters: EvaluationsApiCreateRequest, options?: AxiosRequestConfig) {
        return EvaluationsApiFp(this.configuration).create(requestParameters, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Get evaluation by ID.
     * @summary Get
     * @param {EvaluationsApiGetRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof EvaluationsApiGenerated
     */
    public get(requestParameters: EvaluationsApiGetRequest, options?: AxiosRequestConfig) {
        return EvaluationsApiFp(this.configuration).get(requestParameters, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Get all the evaluations associated with your project.
     * @summary List For Project
     * @param {EvaluationsApiListAllForProjectRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof EvaluationsApiGenerated
     */
    public listAllForProject(requestParameters: EvaluationsApiListAllForProjectRequest, options?: AxiosRequestConfig) {
        return EvaluationsApiFp(this.configuration).listAllForProject(requestParameters, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Get testcases by evaluation ID.
     * @summary List Datapoints
     * @param {EvaluationsApiListDatapointsRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof EvaluationsApiGenerated
     */
    public listDatapoints(requestParameters: EvaluationsApiListDatapointsRequest, options?: AxiosRequestConfig) {
        return paginate({
            initialParameters: requestParameters,
            request: (parameters: EvaluationsApiListDatapointsRequest) => {
                return EvaluationsApiFp(this.configuration).listDatapoints(parameters, options).then((request) => request(this.axios, this.basePath));
            },
        });
    }

    /**
     * Log an evaluation result to an evaluation run.  The run must have status \'running\' and the `evaluator_id` of the result must be one of the `evaluator_id`s associated with the run.
     * @summary Log Result
     * @param {EvaluationsApiLogResultRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof EvaluationsApiGenerated
     */
    public logResult(requestParameters: EvaluationsApiLogResultRequest, options?: AxiosRequestConfig) {
        return EvaluationsApiFp(this.configuration).logResult(requestParameters, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Update the status of an evaluation run.  Can only be used to update the status of an evaluation run that uses external or human evaluators. The evaluation must currently have status \'running\' if swithcing to completed, or it must have status \'completed\' if switching back to \'running\'.
     * @summary Update Status
     * @param {EvaluationsApiUpdateStatusRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof EvaluationsApiGenerated
     */
    public updateStatus(requestParameters: EvaluationsApiUpdateStatusRequest, options?: AxiosRequestConfig) {
        return EvaluationsApiFp(this.configuration).updateStatus(requestParameters, options).then((request) => request(this.axios, this.basePath));
    }
}
